Gardner, who is competing in the Superbike World Championship (WSBK) this year with the Japanese manufacturer, will race at Motegi on October 4-6.
The 26-year-old will carry the factory Yamaha colours with Monster Energy backing.
It will mark the third MotoGP start this year for Gardner after competing at the Sachsenring and Silverstone.
“I am really excited to race in Japan, it’s a country I always enjoyed visiting in Grand Prix racing, but to go to Japan and race for a Japanese manufacturer in MotoGP in front of the Japanese fans will be something special,” said Gardner.
“It is nice that, after Sachsenring and Silverstone, Yamaha have asked me to come back. They clearly feel that I bring something to the development programme, so hopefully we can have a productive weekend in Motegi too.
“It will be a busy period for me with five races in five weeks, but I ride bikes almost every weekend anyway, so it’s nothing new for me.”
Yamaha Factory Racing test team leader Kazutoshi Seki said Gardner’s wildcard entry would help the team in its quest to develop the YZR-M1 bike.
“Bike development is at the heart of Yamaha’s every move this year,” Seki explained.
“The engineers are working very hard, and I am fully convinced that this wild-card entry will accelerate Yamaha’s endeavours to develop prototype parts and increase bike performance.
“Remy Gardner has already successfully tested prototype items for the M1 on two occasions earlier this year, so his prior experience makes him a logical choice in Cal Crutchlow’s absence due to injury.”